Function EXTRACT_BLOCK

Package

convolution

Short description

extract sub block of a 2d matrix

Usage

   x_block = EXTRACT_BLOCK(x, nb_block)

Input

   x (numeric): the 2d input matrix
   nb_block (2x1 int): the vertical and horizontal number of block

Output

   x_block (numeric): a 3d block matrix whos third dimension corresponds
       to block index.

Description

   Split a 2d matrix into blocks of the same dimension whose index
   corresponds to third dimension of the output matrix. This is used
   to compute the inverse fourier transform of a downsampled signal
   by first periodizing the signal.
 Example
   If x contains
      1     5     9    13
      2     6    10    14
      3     7    11    15
      4     8    12    16
   then extract_block(x, [2, 2]) will return
   ans(:,:,1) =
      1     5
      2     6
   ans(:,:,2) =
      3     7
      4     8
   ans(:,:,3) =
      9    13
     10    14
   ans(:,:,4) =
     11    15
     12    16

See also

List of all packages